#pragma once

#include "log/log_define.h"
#include "log/logger.h"

namespace xlog {

/**
 * @brief 日志登记处
 */
class log_registry
{
public:
    static log_registry& instance();
    log_registry(const log_registry&) = delete;
    log_registry& operator = (const log_registry&) = delete;
public:
    void set_global_level(const log_level level);

    log_level get_global_level() const
    { return m_global_level; }

    logger::ptr get_default_logger();
private:
    log_registry();
    ~log_registry() = default;

private:
    log_level m_global_level{ log_level::debug };
    
    logger::ptr m_default_logger;
};

} // namespace xlog

#ifdef XLOG_HEADER_ONLY
#include "log_registry_inl.h"
#endif